package com.kmxd.ams.client.arrange.vo;

import cn.hutool.json.JSONObject;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import java.io.Serializable;
import lombok.Builder;
import lombok.Data;

/**
 * 动态表单对象
 *
 * @author ZuoLG
 */
@Schema(description = "动态表单对象")
@Data
@Builder
public class FormSchemaVO implements Serializable {

  private static final long serialVersionUID = 1L;

  /** ID */
  @Schema(description = "ID")
  @JsonSerialize(using = ToStringSerializer.class)
  private Long id;

  /** 字段 */
  @Schema(description = "字段")
  private String field;

  /** 名称 */
  @Schema(description = "名称")
  private String label;

  /** 输入框类型 Input,ApiRadioGroup, */
  @Schema(description = "输入框类型 Input,ApiRadioGroup,")
  private String component;

  /** 是否必填 */
  @Schema(description = "是否必填")
  private boolean required = false;

  /** 是否显示 */
  @Schema(description = "是否显示")
  private boolean show = false;

  /** 配置对象 */
  @Schema(description = "配置对象")
  @JsonInclude(JsonInclude.Include.NON_NULL)
  private JSONObject componentProps;

  /** 配置提示规则 */
  @Schema(description = "配置提示规则")
  @JsonInclude(JsonInclude.Include.NON_NULL)
  private JSONObject itemProps;

  @Schema(description = "配置列宽")
  @JsonInclude(JsonInclude.Include.NON_NULL)
  private JSONObject colProps;

  @Schema(description = "默认值")
  @JsonInclude(JsonInclude.Include.NON_NULL)
  private String defaultValue;
}
